package fr.inserm.u915.organifooyi.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity(name="protocol")
@Table(name="protocol")
@NamedQueries({
    @NamedQuery(name="protocol.list.all",
            query="select P from protocol as P ORDER BY P.title"),
    @NamedQuery(name="protocol.find.by.type",
    	query="select P from protocol as P where P.type = :type  ORDER BY P.title"),
    @NamedQuery(name="protocol.find.by.title",
	query="select P from protocol as P where P.title = :title ")

	})
public class Protocol
	extends AbstractUpdatableObject
	{
	@Column(name="title",unique=true,length=50)
	private String title;
	
	@Column(name="type")
	private String type;
	
	@Column(name="content")
	private String content;
	
	
	public Protocol()
		{
		}

	public String getTitle() {
		return title;
	}




	public void setTitle(String title) {
		this.title = title;
	}




	public String getType() {
		return type;
	}




	public void setType(String type) {
		this.type = type;
	}




	public String getContent() {
		return content;
	}




	public void setContent(String content) {
		this.content = content;
	}




	@Override
	public String toString()
		{
		return title==null?super.toString():title;
		}
	}
